home *** CD-ROM | disk | FTP | other *** search
- /***************************************************** IMPLEMENTATION
- DATE: 9/20/93
- AUTHOR: Eric R. Rosé
-
- CLASS: CPPMenuBar
-
- SUPERCLASS: CPPObject
-
- This C++ class manages a Macintosh menu bar
-
- ********************************************************************/
-
- #pragma once
-
- #include <CPPList.h>
-
- class CPPMenuBar : public CPPList {
- public:
- CPPMenuBar (short ResID, short appleID);
- CPPMenuBar (void);
- ~CPPMenuBar (void);
-
- virtual char *ClassName (void);
- virtual Boolean Member (char *className);
-
- void DoMenu (short menuID, short theItem);
- void DoMenu (long menuResult);
- MenuHandle MenuFromID (short ResID);
- void BindCommand (short MenuID, short ItemID, short CommandID);
-
- void CheckCommand (short CommandID, Boolean doCheck);
- void EnableCommand (short CommandID);
- void DisableCommand (short CommandID);
- void MarkCommand (short CommandID, char markChar);
- void SetCommandText (short CommandID, StringPtr theString);
- void SetCommandIcon (short CommandID, short theIconID);
- void SetCommandStyle (short CommandID, Style newStyle);
-
- void SetUpHierMenus (short startID, short endID);
-
- void EnableMenuBar (void);
- void DisableMenuBar (void);
-
- protected:
- void AddDAs (short ResID);
- void AddDAs (MenuHandle theMenu);
- void DoAppleMenuItem (short appleMenuID, short theItem);
-
- short MenuToCommand (short menuID, short itemID);
- Boolean CommandToMenuAndItem (short commandID, short *menuID, short *itemID);
- Boolean CommandToMenu (short commandID, MenuHandle *theMenu, short *itemID);
-
- virtual void SetCommandBindings (void);
-
- private:
- Handle theMenuBar;
- MenuHandle appleMenu;
- short appleMenuID;
- };